package edu.univercidade.tcc.sap.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The persistent class for the issue_categories database table.
 * 
 */
@Entity
@Table(name = "issue_categories")
@NamedQueries({
		@NamedQuery(name = "categories", 
				query = "SELECT c "
				+ "FROM IssueCategories c "),
		@NamedQuery(name = "projectCategories", 
				query = "SELECT c "
				+ "FROM IssueCategories c " 
				+ "WHERE c.project IS NULL") })
public class IssueCategory implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(unique = true, nullable = false)
	private int id;

	@Column(nullable = false, length = 30)
	private String name;

	// bi-directional many-to-one association to Project
	@ManyToOne
	@JoinColumn(name = "project_id", nullable = false)
	private Project project;

	// uni-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name = "assigned_to_id")
	private User user;

	public IssueCategory() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}